Optimal. Leaf size=107 \[ a^4 x-\frac {b^2 \left (17 a^2+2 b^2\right ) \cot (c+d x)}{3 d}-\frac {2 a b \left (2 a^2+b^2\right ) \tanh ^{-1}(\cos (c+d x))}{d}-\frac {4 a b^3 \cot (c+d x) \csc (c+d x)}{3 d}-\frac {b^2 \cot (c+d x) (a+b \csc (c+d x))^2}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11, antiderivative size = 107, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.417, Rules used = {3782, 4048, 3770, 3767, 8} \[ -\frac {b^2 \left (17 a^2+2 b^2\right ) \cot (c+d x)}{3 d}-\frac {2 a b \left (2 a^2+b^2\right ) \tanh ^{-1}(\cos (c+d x))}{d}+a^4 x-\frac {4 a b^3 \cot (c+d x) \csc (c+d x)}{3 d}-\frac {b^2 \cot (c+d x) (a+b \csc (c+d x))^2}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3767
Rule 3770
Rule 3782
Rule 4048
Rubi steps
\begin {align*} \int (a+b \csc (c+d x))^4 \, dx &=-\frac {b^2 \cot (c+d x) (a+b \csc (c+d x))^2}{3 d}+\frac {1}{3} \int (a+b \csc (c+d x)) \left (3 a^3+b \left (9 a^2+2 b^2\right ) \csc (c+d x)+8 a b^2 \csc ^2(c+d x)\right ) \, dx\\ &=-\frac {4 a b^3 \cot (c+d x) \csc (c+d x)}{3 d}-\frac {b^2 \cot (c+d x) (a+b \csc (c+d x))^2}{3 d}+\frac {1}{6} \int \left (6 a^4+12 a b \left (2 a^2+b^2\right ) \csc (c+d x)+2 b^2 \left (17 a^2+2 b^2\right ) \csc ^2(c+d x)\right ) \, dx\\ &=a^4 x-\frac {4 a b^3 \cot (c+d x) \csc (c+d x)}{3 d}-\frac {b^2 \cot (c+d x) (a+b \csc (c+d x))^2}{3 d}+\left (2 a b \left (2 a^2+b^2\right )\right ) \int \csc (c+d x) \, dx+\frac {1}{3} \left (b^2 \left (17 a^2+2 b^2\right )\right ) \int \csc ^2(c+d x) \, dx\\ &=a^4 x-\frac {2 a b \left (2 a^2+b^2\right ) \tanh ^{-1}(\cos (c+d x))}{d}-\frac {4 a b^3 \cot (c+d x) \csc (c+d x)}{3 d}-\frac {b^2 \cot (c+d x) (a+b \csc (c+d x))^2}{3 d}-\frac {\left (b^2 \left (17 a^2+2 b^2\right )\right ) \operatorname {Subst}(\int 1 \, dx,x,\cot (c+d x))}{3 d}\\ &=a^4 x-\frac {2 a b \left (2 a^2+b^2\right ) \tanh ^{-1}(\cos (c+d x))}{d}-\frac {b^2 \left (17 a^2+2 b^2\right ) \cot (c+d x)}{3 d}-\frac {4 a b^3 \cot (c+d x) \csc (c+d x)}{3 d}-\frac {b^2 \cot (c+d x) (a+b \csc (c+d x))^2}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 6.25, size = 568, normalized size = 5.31 \[ \frac {a^4 (c+d x) \sin ^4(c+d x) (a+b \csc (c+d x))^4}{d (a \sin (c+d x)+b)^4}+\frac {2 \left (2 a^3 b+a b^3\right ) \sin ^4(c+d x) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right ) (a+b \csc (c+d x))^4}{d (a \sin (c+d x)+b)^4}-\frac {2 \left (2 a^3 b+a b^3\right ) \sin ^4(c+d x) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right ) (a+b \csc (c+d x))^4}{d (a \sin (c+d x)+b)^4}+\frac {\sin ^4(c+d x) \csc \left (\frac {1}{2} (c+d x)\right ) \left (b^4 \left (-\cos \left (\frac {1}{2} (c+d x)\right )\right )-9 a^2 b^2 \cos \left (\frac {1}{2} (c+d x)\right )\right ) (a+b \csc (c+d x))^4}{3 d (a \sin (c+d x)+b)^4}+\frac {\sin ^4(c+d x) \sec \left (\frac {1}{2} (c+d x)\right ) \left (9 a^2 b^2 \sin \left (\frac {1}{2} (c+d x)\right )+b^4 \sin \left (\frac {1}{2} (c+d x)\right )\right ) (a+b \csc (c+d x))^4}{3 d (a \sin (c+d x)+b)^4}-\frac {b^4 \sin ^4(c+d x) \cot \left (\frac {1}{2} (c+d x)\right ) \csc ^2\left (\frac {1}{2} (c+d x)\right ) (a+b \csc (c+d x))^4}{24 d (a \sin (c+d x)+b)^4}+\frac {b^4 \sin ^4(c+d x) \tan \left (\frac {1}{2} (c+d x)\right ) \sec ^2\left (\frac {1}{2} (c+d x)\right ) (a+b \csc (c+d x))^4}{24 d (a \sin (c+d x)+b)^4}-\frac {a b^3 \sin ^4(c+d x) \csc ^2\left (\frac {1}{2} (c+d x)\right ) (a+b \csc (c+d x))^4}{2 d (a \sin (c+d x)+b)^4}+\frac {a b^3 \sin ^4(c+d x) \sec ^2\left (\frac {1}{2} (c+d x)\right ) (a+b \csc (c+d x))^4}{2 d (a \sin (c+d x)+b)^4} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.78, size = 217, normalized size = 2.03 \[ -\frac {2 \, {\left (9 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{3} - 3 \, {\left (2 \, a^{3} b + a b^{3} - {\left (2 \, a^{3} b + a b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 3 \, {\left (2 \, a^{3} b + a b^{3} - {\left (2 \, a^{3} b + a b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 3 \, {\left (6 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right ) - 3 \, {\left (a^{4} d x \cos \left (d x + c\right )^{2} - a^{4} d x + 2 \, a b^{3} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{3 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.78, size = 205, normalized size = 1.92 \[ \frac {b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 24 \, {\left (d x + c\right )} a^{4} + 72 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 9 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 48 \, {\left (2 \, a^{3} b + a b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - \frac {176 \, a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 88 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 72 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 9 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 12 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b^{4}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}}}{24 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.39, size = 139, normalized size = 1.30 \[ a^{4} x +\frac {a^{4} c}{d}+\frac {4 a^{3} b \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}-\frac {6 a^{2} b^{2} \cot \left (d x +c \right )}{d}-\frac {2 a \,b^{3} \cot \left (d x +c \right ) \csc \left (d x +c \right )}{d}+\frac {2 a \,b^{3} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}-\frac {2 b^{4} \cot \left (d x +c \right )}{3 d}-\frac {b^{4} \cot \left (d x +c \right ) \left (\csc ^{2}\left (d x +c \right )\right )}{3 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.34, size = 125, normalized size = 1.17 \[ a^{4} x + \frac {a b^{3} {\left (\frac {2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{d} - \frac {4 \, a^{3} b \log \left (\cot \left (d x + c\right ) + \csc \left (d x + c\right )\right )}{d} - \frac {6 \, a^{2} b^{2}}{d \tan \left (d x + c\right )} - \frac {{\left (3 \, \tan \left (d x + c\right )^{2} + 1\right )} b^{4}}{3 \, d \tan \left (d x + c\right )^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.62, size = 314, normalized size = 2.93 \[ \frac {b^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}-\frac {b^4\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}-\frac {3\,b^4\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}+\frac {3\,b^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}+\frac {2\,a^4\,\mathrm {atan}\left (\frac {\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3+4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b+2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^3}{-\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3+4\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b+2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^3}\right )}{d}+\frac {2\,a\,b^3\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {4\,a^3\,b\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {3\,a^2\,b^2\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d}-\frac {a\,b^3\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{2\,d}+\frac {3\,a^2\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d}+\frac {a\,b^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{2\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \csc {\left (c + d x \right )}\right )^{4}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________